#include <iostream>
#include <fstream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    ifstream fin;
    string str;
    vector<string> vec, vec2;

    fin.open("/home/zhaoj/code/C++Primar/Ex8_3/main.cpp");
    while(getline(fin, str))
    {
        vec.push_back(str);
    }
    fin.clear();
    fin.close();

    fin.open("/home/zhaoj/code/C++Primar/Ex8_3/main.cpp");
    while(fin >> str)
    {
        vec2.push_back(str);
    }
    fin.clear();
    fin.close();

    for(vector<string>::iterator i = vec.begin(); i != vec.end(); ++i)
        cout << *i << endl;
    for(vector<string>::iterator i = vec2.begin(); i != vec2.end(); ++i)
        cout << *i << endl;
    return 0;
}
